﻿Imports Phila
Imports Phila.Sql
Imports Phila.CommonClasses
Imports Telerik.WebControls

Public Class ViewTourCost
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    End Sub

    Protected Sub radGrdCost_DeleteCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles radGrdCost.DeleteCommand
        Dim ID As String = (CType(e.Item, GridDataItem)).OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ID").ToString
        Try
            Insert_Update_Delete_Record("delete from ptn_tourcost where id=" & ID)
        Catch ex As Exception
            lblMsg.Text = "Unable to Delete Record. Reason: " + ex.Message
            lblMsg.ForeColor = Drawing.Color.Red
            e.Canceled = True
        End Try
    End Sub

    Protected Sub radGrdCost_NeedDataSource(ByVal source As Object, ByVal e As Telerik.WebControls.GridNeedDataSourceEventArgs) Handles radGrdCost.NeedDataSource
        Fill_Grid(radGrdCost, "select tc.Id, t.Name as TourName, CONVERT(VARCHAR(10), tc.StartDate, 103) StartDate, CONVERT(VARCHAR(10), tc.EndDate, 103) EndDate,tc.[TourId], tc.[Pax_1], tc.[Pax_2], tc.[Pax_3], tc.[Pax_4], tc.[Pax_5], tc.[Pax_6], tc.[Pax_7], tc.[Pax_8], tc.[Pax_9], tc.[Pax_Child], tc.[Single_Supp], tc.[Valid], tc.[ClientType] from ptn_TourCost tc inner join ptn_Tours t on t.Id=tc.TourId")
    End Sub

End Class